package com.kabao.javafx.qq;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;
import javafx.stage.StageStyle;

/**
 * 测试javafx stage样式，系统托盘问题
 */
public class StageStyleApp extends Application {
    @Override
    public void start(Stage stage) throws Exception {
        stage.initStyle(StageStyle.UNIFIED);
        stage.setScene(new Scene(new BorderPane(),100,100));
        stage.setX(18000);
        stage.show();

        //显示内容的舞台,风格为透明的
        Stage mainStage = new Stage(StageStyle.TRANSPARENT);
        mainStage.initOwner(stage);
        Button button = new Button("测试");
        button.setOnAction(event -> {
            System.out.println("event = " + "hello");
        });
        mainStage.setScene(new Scene(new BorderPane(button),300,300));
        mainStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}
